package com.cwvs.cat.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.cwvs.cat.R;

public class MyDynamicAdapter extends BaseAdapter {

	private LayoutInflater mInflater = null;
	private ViewHolder holder = null;
	private List<String> mList;

	public MyDynamicAdapter(Context context, List<String> list){
		this.mInflater = LayoutInflater.from(context);
		mList = list;
		
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mList.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		
		convertView = mInflater.inflate(R.layout.item_list_my_dynamic, null);
		
		holder = new ViewHolder();
		holder.name1 = (TextView) convertView.findViewById(R.id.name_1);
		convertView.setTag(holder);

		return convertView;
	}
	
	static class ViewHolder{
        public TextView name1;

    }

}
